<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <link href="https://cdn.bootcss.com/twitter-bootstrap/3.0.1/css/bootstrap.min.css" rel="stylesheet">
</head>
<body>
<div class="container">
    <div class="row">
        <div class="span12">
            <form class="form-search" action="/rstore/all" method="post">
                入库单号：<input class="input-medium search-query" type="text" name="ruid" placeholder="入库单号"/>
                &nbsp &nbsp 类型：
                <select name="rtype">
                    <option value="">全部</option>
                    <option value="1">采购入库</option>
                    <option value="2">退货入库</option>
                </select>
                &nbsp &nbsp 仓库名称：
                <select name="gnid">
                    <option value="">全部</option>
                    <#list gnumbers as g>
                        <option value="${g.gnid}">${g.gname}</option>
                    </#list>
                </select>
                &nbsp &nbsp 状态：
                <select name="state">
                    <option value="">全部</option>
                    <option value="3">待入库</option>
                    <option value="1">待记账</option>
                    <option value="2">已入库</option>
                </select>
                <button type="submit" class="btn">查找</button>
            </form>
            <form action="/rstore/daochu" method="post">
                <table class="table">
                    <thead>
                    <tr>
                        <th colspan="9">数据列表</th>
                        <th><button type="button" class="btn"><a href="/rstore/addbefore">添加</a></button></th>
                        <th><button type="submit" class="btn">导出</button></th>
                    </tr>
                    <tr>
                        <th> </th>
                        <th>入库单号</th>
                        <th>源订单ID</th>
                        <th>创建日期</th>
                        <th>类型</th>
                        <th>供应商/客户名称</th>
                        <th>入库仓库</th>
                        <th>入库时间</th>
                        <th>经办人</th>
                        <th>状态</th>
                        <th>操作</th>
                    </tr>
                    </thead>
                    <tbody>
                    <#list store as s>
                        <tr class="success">
                            <td><input type="checkbox" name="ruids" value="${s.ruid}"> </td>
                            <td>${s.ruid}</td>
                            <td>${s.oid}</td>
                            <td><span class="time">${s.ctime?string('yyyy-MM-dd HH:mm:ss')}</span></td>
                            <td>
                                <#if s.rtype==1>
                                    采购入库
                                    <#else >
                                    退货入库
                                </#if>
                            </td>
                            <td>${s.rname}</td>
                            <td>${s.gnumber.gname}</td>
                            <td><span class="time">${s.storetime?string('yyyy-MM-dd HH:mm:ss')}</span></td>
                            <td>${s.storeadmin}</td>
                            <#if s.state==3>
                                    <td>待入库</td>
                                    <td><a href="/rstore/detail?ruid=${s.ruid}">查看</a></td>
                                    <td><a href="/rstore/updatebefore?ruid=${s.ruid}">编辑</a></td>
                            <#elseif s.state==2>
                                <td>已入库</td>
                                <td><a href="/rstore/detail?ruid=${s.ruid}">查看</a></td>
                            <#else >
                                <td>待记账</td>
                                <td><a href="/rstore/detail?ruid=${s.ruid}">查看</a></td>
                            </#if>
                        </tr>
                    </#list>
                    </tbody>
                </table>
            </form>
            <div style="text-align: center">
                <ul class="pagination">
                    <li>
                        <a href="?pageNum=1">首页</a>
                    </li>
                    <li>
                        <#if page.hasPreviousPage><a href="?pageNum=${page.prePage}">上一页</a>
                        <#else><a href="#">上一页</a></#if>
                    </li>
                    <#list 1..page.pages as p>
                        <#if p==page.pageNum >
                            <li class="active">
                                <a href="?pageNum=${p}">${p}</a>
                            </li>
                        <#else>
                            <li>
                                <a href="?pageNum=${p}">${p}</a>
                            </li>
                        </#if>
                    </#list>
                    <li>
                        <#if page.hasNextPage>
                            <a href="?pageNum=${page.nextPage}">下一页</a>
                        <#else><a href="#">下一页</a></#if>
                    </li>


                    <li>
                        <a href="?pageNum=${page.pages}">最后页</a>
                    </li>
                </ul>
            </div>
        </div>
    </div>
</div>
<script src="http://libs.baidu.com/jquery/1.9.0/jquery.js"></script>
<script>
    $(function(){
        document.getElementById("checkbox").onclick = function(event){ // 事件发生时，产生的对象
            var checked = event.target.checked; //点击多选框的状态  true选择  false未选择
            var elements = document.getElementsByName("ruids");
            for(var i=0;i<elements.length;i++){
                elements[i].checked = checked;
            }
        }
    })
</script>
</body>
</html>